get the oid
От | Niclas Hedell |
---|---|
Тема | get the oid |
Дата | |
Msg-id | p05200f02ba926fc45c53@[192.168.0.25] обсуждение исходный текст |
Ответы |
Re: get the oid
Re: get the oid |
Список | pgsql-novice |
Hi list,
I'm not only a novice to pgsql but also to sql in general (as well as new in this list)...
Here's my question: Why doesn't the following function work?
create function getoid(name) returns integer as '
declare
declare
ret integer;
tablename alias for $1;
begin
select into ret oid from tablename;
return ret;
end;'
language 'plpgsql';
end;'
language 'plpgsql';
The idea is to get the oid (or whatever) from a table given by its name as a parameter to the function. It seems that the 'from' clause can't get the right table when passing a variable with the table name. I've tried everything to get this to work (castings, subqueries, etc, etc,...)
Thanx in advance! :-)
Cheers,
Nick
В списке pgsql-novice по дате отправления: